package com.javaclimb.jxnu.dao;

import com.javaclimb.jxnu.domain.Comments;
import com.javaclimb.jxnu.domain.Post;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

@Mapper
public interface CommentsMapper {

    List<Comments>  findAllComments();
    List<Comments> findCommentsByPostIDL(int post_id);
    List<Comments> findCommentsByUserIDL(int user_id);
    Comments findCommentsByPostID(int post_id);
    Comments findCommentsByUserID(int user_id);
    void addComments(int post_id,int user_id,String comments_content);


    int selectSumCommentsBYTime(int user_id,String startTime,String endTime);
    int selectSumComments_nextBYTime(int user_id,String startTime,String endTime);


    List<Map<String,Object>> findAllComments2();
    List<Map<String,Object>> select(String post_title, String post_author, String comments_name,String sort);
    void deleteComments(int id);


    List<Map<Integer,Object>> findmycomments(int user_id);//2.21
}
